package ru.ifmo.kis.domaingen;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

// Nov 24, 2010 4:17:42 PM
@javax.persistence.Table(name = "orders", catalog = "ItmoKis")
@Entity
public class OrdersEntity {
	private int id;

	@Id
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	private int customer;

	@javax.persistence.Column(name = "customer", nullable = true, insertable = true, updatable = true, length = 10, precision = 0)
	@Basic
	public int getCustomer() {
		return customer;
	}

	public void setCustomer(int customer) {
		this.customer = customer;
	}

	private int status;

	@javax.persistence.Column(name = "status", nullable = true, insertable = true, updatable = true, length = 10, precision = 0)
	@Basic
	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	private int deadline;

	@javax.persistence.Column(name = "deadline", nullable = true, insertable = true, updatable = true, length = 10, precision = 0)
	@Basic
	public int getDeadline() {
		return deadline;
	}

	public void setDeadline(int deadline) {
		this.deadline = deadline;
	}

	private int approved;

	@javax.persistence.Column(name = "approved", nullable = true, insertable = true, updatable = true, length = 10, precision = 0)
	@Basic
	public int getApproved() {
		return approved;
	}

	public void setApproved(int approved) {
		this.approved = approved;
	}

	private int finished;

	@javax.persistence.Column(name = "finished", nullable = true, insertable = true, updatable = true, length = 10, precision = 0)
	@Basic
	public int getFinished() {
		return finished;
	}

	public void setFinished(int finished) {
		this.finished = finished;
	}

/*	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		OrdersEntity that = (OrdersEntity) o;

		if (approved != that.approved) return false;
		if (customer != that.customer) return false;
		if (deadline != that.deadline) return false;
		if (finished != that.finished) return false;
		if (id != that.id) return false;
		if (status != that.status) return false;

		return true;
	}

	@Override
	public int hashCode() {
		int result = id;
		result = 31 * result + customer;
		result = 31 * result + status;
		result = 31 * result + deadline;
		result = 31 * result + approved;
		result = 31 * result + finished;
		return result;
	}*/

	private ProductsEntity product;

	@ManyToOne
	public
	@javax.persistence.JoinColumn(name = "product_id", referencedColumnName = "id", nullable = true)
	ProductsEntity getProduct() {
		return product;
	}

	public void setProduct(ProductsEntity product) {
		this.product = product;
	}
}
